package com.lemon.cloud.admin.web;

import com.lemon.cloud.admin.entity.SysApplication;
import com.lemon.cloud.admin.service.SysApplicationService;
import com.lemon.cloud.comm.model.ResultMsg;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("application")
@Tag(name = "应用接口")
public class SysApplicationController {

    @Autowired
    private SysApplicationService sysApplicationService;

    @GetMapping("/applications")
    @Operation(
            summary = "查询全部应用",description = "查询全部客户端信息",
            responses = {
                    @ApiResponse(responseCode = "200",description = "successful operation",content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,schema = @Schema(implementation = List.class))},useReturnTypeSchema = true)
            }
    )
    public ResultMsg<List<SysApplication>> getAllApp(){
        return ResultMsg.resultSuccess(sysApplicationService.list());
    }

}
